package hong.jun.pet_home.service.pet.impl;


import hong.jun.basic.base.service.impl.BaseServiceImpl;
import hong.jun.pet_home.domain.pet.Pet;
import hong.jun.pet_home.mapper.PetDetailMapper;
import hong.jun.pet_home.mapper.PetMapper;
import hong.jun.pet_home.service.pet.IPetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.Serializable;

@Service
public class PetServiceImpl extends BaseServiceImpl<Pet> implements IPetService {
    @Autowired
    private PetMapper petMapper;
    @Autowired
    private PetDetailMapper detailMapper;

    /**
     * 新增
     */
    @Override
    public void save(Pet pet) {
        super.save(pet);

    }

    /**
     * 修改
     */
    @Override
    public void update(Pet pet) {
        super.update(pet);

    }

    /**
     * 删除
     */
    @Override
    public void delete(Serializable id) {
        super.delete(id);

    }

    /**
     * 批量删除
     */
    @Override
    public void deletes(Serializable[] ids) {
        super.deletes(ids);

    }


    @Override
    public void on_shelf(Pet pet) {
        pet.setState(1);
        petMapper.update(pet);
    }
}
